﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BL;
using DA;
using UI.Models;

namespace UI.Controllers
{
    public class CategoriesController : Controller
    {
        //
        // GET: /Categories/

        public ActionResult Index(int deptId, int VIPNumber)
        {
            CategoriesRepository rep = new CategoriesRepository();
            IEnumerable<Category> categories = rep.GetList();
            categories = categories.Where(x => x.DeptId == deptId);
            CatListModel categoriesList = new CatListModel();

            categoriesList.VIPNumber = VIPNumber;
            categoriesList.Categories = categories;
            return View(categoriesList);

        }

    }
}
